﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

// Khai báo 1 delegate DropDownList1_SelectedIndexChanged.
public delegate void DropDownList1_SelectedIndexChanged(object sender, EventArgs e);
public partial class MyControl : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    public MultiView multiView
    {
        get
        {
            return MultiView1;
        }
        set
        {
            MultiView1 = value;
        }
    }
    public View panel1
    {
        get { return View1; }
        set { View1 = value; }
    }
    public View panel2
    {
        get { return View2; }
        set { View2 = value; }
    }
    public View panel3
    {
        get { return View3; }
        set { View3 = value; }
    }
    public DropDownList ddlChoicePanel {
        get { return DropDownList1; }
        set { DropDownList1 = value; }
    }
    // tạo một biến event tên là : ddlSelectedIndexChanged , mục đích để nhận "chức năng" được truyền vào bên form Default 
    public event DropDownList1_SelectedIndexChanged ddlSelectedIndexChanged;
    protected virtual void DdlChoicePanelChange(EventArgs e)
    {
        // su dung event delegate ddlSelectedIndexChanged()
        ddlSelectedIndexChanged(this,e);
    }
    protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
    {
        // goi virtual method DdlChoicePanelChange()
        DdlChoicePanelChange(e);
    }
}